var s = 'www.jb51.net';
var n = (s.split('.')).length-1;
console.log(n)

function patch(re,s){
    re=eval("/"+re+"/ig")
    return s.match(re).length;
  }
  var s = 'http://local.dev-zuma.com/admin/pay_basic/transactionPunish/addPunish?id=c71a6bae-81c9-4ba1-9cdb-f65839051ff8';
  console.log(patch('/',s)); //弹出2

 
